<?php

namespace Agp\CoreBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Security\Acl\Model\DomainObjectInterface;

/**
 * Agp\CoreBundle\Entity\PostComentario
 *
 * @ORM\Table(name="post_comentario")
 * @ORM\Entity(repositoryClass="Agp\CoreBundle\Repository\PostComentarioRepository")
 */
class PostComentario implements DomainObjectInterface
{
    /**
     * @var integer $codPostComentario
     *
     * @ORM\Column(name="cod_post_comentario", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $codPostComentario;

    /**
     * @var \DateTime $dtEntrada
     *
     * @ORM\Column(name="dt_entrada", type="datetime")
     */
    protected $dtEntrada;

    /**
     * @var string $conteudo
     *
     * @ORM\Column(name="conteudo", type="text")
     * @Assert\NotBlank
     */
    protected $conteudo;

    /**
     * @ORM\ManyToOne(targetEntity="Agp\CoreBundle\Entity\Pessoa", cascade={"persist"}, fetch="LAZY")
     * @ORM\JoinColumn(name="cod_pessoa", referencedColumnName="cod_pessoa", onDelete="restrict", nullable=false)
     * @var object
     */
    protected $pessoa;
    
    /**
     * @ORM\ManyToOne(targetEntity="Agp\CoreBundle\Entity\Post", cascade={"persist"}, fetch="LAZY", inversedBy="comentarios")
     * @ORM\JoinColumn(name="cod_post", referencedColumnName="cod_post", nullable=false)
     * @var object
     */
    protected $post;
    
    public function getObjectIdentifier() {
        return $this->codPostComentario;
    }

    public function __construct() {
        $this->dtEntrada = new \DateTime;
    }
    
    public function getCodPostComentario() {
        return $this->codPostComentario;
    }

    public function setCodPostComentario($codPostComentario) {
        $this->codPostComentario = $codPostComentario;
    }

    public function getDtEntrada() {
        return $this->dtEntrada;
    }

    public function setDtEntrada($dtEntrada) {
        $this->dtEntrada = $dtEntrada;
    }

    public function getConteudo() {
        return $this->conteudo;
    }

    public function setConteudo($conteudo) {
        $this->conteudo = $conteudo;
    }

    public function getPessoa() {
        return $this->pessoa;
    }

    public function setPessoa($pessoa) {
        $this->pessoa = $pessoa;
    }
    
    public function getPost() {
        return $this->post;
    }

    public function setPost($post) {
        $this->post = $post;
    }

}
